﻿
function printDialogPreview(path) {

    if (!path) path = "";
    if ($("div").index($("#dialog-report")) == -1)
        $("body").after("<div id='dialog-report' icon='icon-print' style='background:#fafafa;padding:10px;width:800px;height:600px;'></div>");

    $('#dialog-report').dialog({ modal: true, title: '打印报表' });
    $("#dialog-report").empty();
    $("#dialog-report").load(path + "../../../WebPlugin/CrystalReport/PrintReport.aspx", function() {
        $('#ReportViewer1').height($('#reportDiv').height());
        $('#ReportViewer1').width($('#reportDiv').width());
    });
}

function printDivPreview(divContainerObj,path) {
    if (!path) path = "";
    divContainerObj.empty();
    var html = '<iframe id="resultDataMain" name="resultDataMain" region="center" frameborder="no" resizable="yes" height="100%" width="100%" src="../../../WebPlugin/CrystalReport/PrintReport.aspx"></iframe>';
    divContainerObj.append(html);
    //window.open("../Controller.aspx?controller=ReportController&method=LoadPageResultData&random=" + sRandom + "&titleId=" + tableid, "resultDataMain");
    //    divContainerObj.load(path + "../../../WebPlugin/CrystalReport/PrintReport.aspx", function() {
    //        $('#ReportViewer1').height($('#reportDiv').height());
    //        $('#ReportViewer1').width($('#reportDiv').width());
    //    });
}

function printConfirm(path) {
    if (!path) path = "";
    if ($("div").index($("#div-report")) == -1)
        $("body").after("<div id='div-report'></div>");
    $("#div-report").empty();
    $("#div-report").load(path + "../../../WebPlugin/CrystalReport/PrintReport.aspx");
    $("#div-report").hide();
    $("#ReportViewer1_ctl01_ctl07_ctl00_ctl00").click();
}
